Skip to content

Conversation

stefanberger
Copy link

@stefanberger stefanberger commented Oct 6, 2025

Purpose

This PR adds a plugin registry for AI model validation plugins and sets callbacks from which the plugins are invoked. The model validation can be used on AI models and LoRA adapters and therefore the plugin points are set to verify:

  • AI models available in the filesystem
  • AI models that are downloaded from Huggingface hub
  • LoRA adapters when they are loaded

The first plugin to use this new infrastructure will be used for integrity and provenance verification of AI models and LoRA adapters and will be hosted outside the vLLM repository.

Test Plan

The following new tests have been added:

pytest tests/v1/engine/test_engine_core_model_validation.py
pytest tests/model_executor/model_loader/test_model_validation.py

The following existing test have been extended:

pytest tests/lora/test_lora_manager.py

Test Result


Essential Elements of an Effective PR Description Checklist
  • The purpose of the PR, such as "Fix some issue (link existing issues this PR will resolve)".
  • The test plan, such as providing test command.
  • The test results, such as pasting the results comparison before and after, or e2e results
  • (Optional) The necessary documentation update, such as updating supported_models.md and examples for a new model.
  • (Optional) Release notes update. If your change is user facing, please update the release notes draft in the Google Doc.

@stefanberger
Copy link
Author

@njhill FYI

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a plugin registry for AI model validation, allowing for integrity and provenance checks on models and LoRA adapters. Callbacks are added at various points in the model and adapter loading process to invoke these validation plugins. The changes span across model loaders, LoRA management, and the V1 engine core, with corresponding tests to ensure the validation mechanism is triggered correctly. The error reporting for LoRA loading failures is also improved. My review found a critical issue in the GGUF model loader that would prevent loading models from a URL.

Add a model validation plugin registry where classes implementing the
ModelValidationPlugin interface can be registered.

Enable the validating on local models that have already been downloaded
by the user.

Add a test case with an already downloaded model whose config.json is
unmodified so that a ModelConfig can be created from it.

Signed-off-by: Stefan Berger <[email protected]>
Extend a LoRARequest with a validate() method to enable validation of a
LoRA adapter when it is loaded.

Add a test case.

Signed-off-by: Stefan Berger <[email protected]>
Implement a method 'validate' in the BaseModelLoader that first checks
whether any plugin requests to validate the given model and then possibly
downloads all the model files, including the signature. For this, query
the subclass of BaseModelLoader for its download type. Support validation
of local models and those downloaded from Huggingface Hub.

Add a test case.

Signed-off-by: Stefan Berger <[email protected]>
Extend the reporting of an error over RPC by the cause of the error if it
is known. This then for example not only reports that the signature
verification failed but also the reason, such as when an unsigned file was
found.

Signed-off-by: Stefan Berger <[email protected]>
…aded

The reason why a LoRA adapter could not be loaded may include information
from model validation, such as that model signature verification did not
succeed because unsigned files were found.

Signed-off-by: Stefan Berger <[email protected]>
@stefanberger stefanberger force-pushed the validation-plugin.4upstream branch from 0087ecd to a150791 Compare October 6, 2025 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant